home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / 1115.zip / 1115.TXT next >
Text File  |  1993-03-08  |  5KB  |  110 lines

  1.                                FYI
  2.  
  3. (Note:  The origin of this information may be internal or external to Novell. 
  4. Novell makes every effort within its means to verify this information. 
  5. However, the information provided in this document is FOR YOUR INFORMATION
  6. only.  Novell makes no explicit or implied claims as to the validity of this
  7. information.)
  8.  
  9.           TITLE:  USING SID INSTEAD OF DEBUG TO CREATE A UTILITY
  10.    DOCUMENT ID#:  FYI-M-1115
  11.            DATE:  06JAN93
  12.         PRODUCT:  DR DOS
  13. PRODUCT VERSION:  6.0
  14.      SUPERSEDES:  13APR92
  15.  
  16.         SYMPTOM:  NEED TO TRANSLATE DEBUG INSTRUCTIONS INTO SID
  17.  
  18.   ISSUE/PROBLEM:  Many publications and bulletin board services distribute
  19. scripts written in DEBUG to create various utilities.  To make use of these
  20. scripts in DR DOS the script must be generated in SID.
  21.  
  22.        SOLUTION:  Below is a generic listing of a typical DEBUG script and the
  23. steps that are used to adjust it so that the DR DOS SID utility will produce
  24. the same results.
  25.  
  26. Typically, DEBUG scripts follow this pattern: DEBUG first establishes the name
  27. of the file.  The "A" command is used to start assembling the instruction.
  28. DEBUG defaults to an offset of 100.  Then the instructions for the utility
  29. itself are listed. Finally, using the "RCX" command DEBUG is instructed as to
  30. how many bytes of information should be saved.
  31.  
  32. SID does not require the name of the file until the file is actually saved. In
  33. SID, the "A100" command is the instruction that begins assembly at offset 100.
  34. The instructions for the utility itself are listed next. These instructions are
  35. the same under both DEBUG and SID.  When a file is saved using SID, the
  36. beginning and ending addresses must be specified. The beginning address is 100. 
  37. The ending address is 100 + the number of bytes to be saved minus 1 (In the
  38. example below, the ending address is represented by the word END).
  39.  
  40. The arithmetic is in hexadecimal values, but it is possible to do the
  41. calculations in SID using the "H" command.  (See the HEX NOTE below). The last
  42. command is Quit. It is the same under both utilities.
  43.  
  44.  
  45.  
  46. GENERIC SCRIPT
  47.  
  48. DEBUG SCRIPT    SID SCRIPT              COMMENTS
  49. -----------------------------------------------------------------
  50. N filename.ext  (not required)         -SID uses file name when it is saved.
  51. A               A100        ---------+ -Begin assembling instructions.
  52. (instructions   (instructions        | -Use the original commands.
  53. go              go                   |
  54. here)           here)                |
  55.                                      |
  56. <CR>            <CR>                 | -<CR> to exit assembling
  57. RCX             (not required)       | -DEBUG is preparing to save y bytes
  58. y               (not required)       |   of data. +----------------+
  59. W               Wfilename.ext,100,END| -SID writes|from offset 100 to END
  60.                                      |    ( 100 + y - 1 = END )
  61.                                      |       |
  62.                                      +-------+
  63. Q               Q                       -And Quit.
  64.  
  65.  
  66. Below is an example of a script that will build BEEP.COM, a program that simply
  67. beeps the speaker once. Notice again that the arithmetic is in hexadecimal. (If
  68. that is something with which you are unfamiliar, see the HEX NOTE at the end of
  69. this example.)
  70.  
  71.  
  72. DEBUG SCRIPT    SID SCRIPT      COMMENTS
  73. -----------------------------------------------------------------N BEEP.COM     
  74. (not required)          SID saves file name at end
  75. A               A100        --------+   Begin assembling instructions
  76. MOV AH,2        MOV AH,2            |   Use the original commands
  77. MOV DL,07       MOV DL,07           |
  78. INT 21          INT 21              |
  79. MOV AH,4C       MOV AH,4C           |
  80. INT 21          INT 21              |
  81. <CR>            <CR>                |   <CR> to exit assembling
  82. RCX             (not required)      |   DEBUG is preparing to save 10 (A Hex)
  83. A               (not required)      |   of data.  +----------------+
  84. W               WKEYD.COM,100,109   |   SID writes|from offset 100 to 109
  85. Q               Q                   |     ( 100 + A - 1 = 109 )
  86.                                     |        |
  87.                                     +--------+
  88.  
  89.  
  90. HEX NOTE:  SID can do the hex math for you. In the above example,  to do the
  91. first addition ( 100 + A ), load SID and type
  92.  
  93.                 H100 A
  94.  
  95.                 SID will respond:
  96.  
  97.                 + 010A   - 00F6   * 00000A00   / 0019 (0006)
  98.  
  99. The first value, 010A, is the sum. Use that value in the next command:
  100.  
  101.                 H10A 1
  102.  
  103.                 SID will respond:
  104.  
  105.                 + 010B   - 0109   * 0000010A   / 010A (0000)
  106.  
  107. The second value, 0109, is the END value you want to use.
  108.  
  109.  
  110. ADDITIONAL REFERENCES:  DR DOS 6 User Guide, Appendix D & FYI-M-1114